<template>
  <!-- 计算属性 -->
  <div>
    <input type="text" @input="jian" v-model="zhi" />
    <ul>
      <li v-for="(i, item) in arrnew" :key="item">{{ i }}</li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      arr: ["阿迪鞋子", "耐克鞋", "李宁鞋", "乔丹鞋子"],
      arrnew: [],
      zhi: "",
    };
  },
  methods: {
    jian() {
      this.arrnew = [];
      this.arr.forEach((item) => {
        if (this.zhi) {
          if (item.indexOf(this.zhi) != -1) {
            this.arrnew.push(item);
          }
        }
      });
    },
  },
};
</script>

<style>
</style>